{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "036142e5",
   "metadata": {},
   "source": [
    "### 决策回归树案例【线性回归对比】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "23e498db",
   "metadata": {},
   "source": [
    "#### 创建数据可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f2ee47ed",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:23:00.056573Z",
     "start_time": "2022-07-01T12:22:59.947108Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x2029eb9f340>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAANUAAADCCAYAAADek4egAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAOt0lEQVR4nO3db6wc1XnH8e+vl39+FQO2qE0AQ0NJUF2V9ApQLVVV0ojEqsAhSQVRFFyBKGqjvqiE6ihRK0VEOOVF/yVqYlFUUCVCihLHUVxZJC6KFMkupqYxBFEMEsUXBwzUSFVdAs7TFzvXLNez9+7snpmdM/P7SFfeP6OdszPn8Zx55pk9igjMLJ1fmnUDzLrGQWWWmIPKLDEHlVliDiqzxBxUZomdMesGjLJmzZrYsGHDrJthVurxxx9/NSLWlr3X2qDasGEDBw4cmHUzzEpJemHUex7+mSXmoDJLLMnwT9J9wO8Br0TEr5W8L+BvgM3A/wJbI+LfU6zblvfFnYd4cP+LnIxgTuLmay7iri0bZ92sTkt1TvWPwFeBB0a8/zHg8uLvGuDvi3+top0HF7hnzzO8dPwE61ev4s7rrmDLVReWLvvFnYf4p33/der5yYhTz0cFVpXPt3JJhn8R8SPg9WUWuQF4IAb2AaslrUux7j7ZeXCBz3/7EAvHTxDAwvETfP7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D4Lzi9XkGdz8D/BZwiEHW6xBwa43tOe37A18Cri8enwP8M3AY+Dfgsob230rtuht4qthG/wq8v4E2PQgcBd4q+tatwB3AHcX7YvCblc8V+60067z0zxUVZol1bfhnNnMOKrPEHFRmiTmozBJzUJkl5qAyS8xBZZaYg8ossf8HftWYnp/7Vz0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "from sklearn.tree import DecisionTreeRegressor\n",
    "from sklearn import tree\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.linear_model import LinearRegression\n",
    "import matplotlib.pyplot as plt\n",
    "import graphviz\n",
    "\n",
    "X = np.linspace(0,2*np.pi,40).reshape(-1,1) # 数据，特征，训练数据\n",
    "X_test = np.linspace(0,2*np.pi,199).reshape(-1,1) # 待测试数据，差异\n",
    "\n",
    "# y 一个正弦波，余弦波，圆\n",
    "y = np.c_[np.sin(X),np.cos(X)] # 正弦和余弦\n",
    "\n",
    "# 画图--->圆\n",
    "plt.figure(figsize=(3,3))\n",
    "plt.scatter(y[:,0],y[:,1])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "82b8100d",
   "metadata": {},
   "source": [
    "#### 线性回归建模"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "4f290e2b",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:23:07.185345Z",
     "start_time": "2022-07-01T12:23:07.095641Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x2029ebf8550>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMsAAADNCAYAAAAWooQuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0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CYJTksZkkOi1mSw2KW5LCYJTksZkkOi1mSw2KWpAn+C8ruO6i0Dfj9wA/cmxnAX5ouIsm11ueFEXFAtxWNhGVPIGkkIoabriPDtQ6GL8PMkhwWsySHZXxLmy6gB651ANxnMUvymcUsyWEpJE2XtELSxvJ12jjb/acMznG3pOUDrG+epPskjUpa3GX9fpIuL+tXSRoaVG1dapms1kWStnW8jx9uos6eRYSn6lL0fGBxmV8MfHmc7R5toLZ9gPuBQ4ApwD3AS8ds81HgG2X+vcDlDb2PmVoXARc0/Zn3OvnMssMpwMVl/mJgQXOl/J9jgNGIeCAi/g1cRlVvp876rwROkKQB1rhdptY9ksOyw4ERsaXM/wk4cJztniFpRNJKSQsGUxqzgAc7Xm8qy7puE9Vg7X8Dnj+Q6sapo+hWK8C7yqNKrpQ0ZzCl9aevccP2NBON29z5IiJC0ni3CV8YEZslHQL8TNKaiLi/7lr3ctcAyyLiX5I+QnVGPL7hmib1lApLTDBus6Q/S5oZEVskzQS2jtPG5vL1AUm3AEdRXaPvTpuBzp++s8uybttskvR04HnAX3dzXd1MWmtEdNZ1IVV/sfV8GbbDcmBhmV8I/GjsBpKmSdqvzM8AXgusH0BtdwKHSTpY0hSqDvzYO3Gd9b8b+FmU3vSATVpr+WG03XxgwwDr23VN32Foy0R1fX8TsBG4EZhelg8DF5b544A1VHd41gBnDLC+k6mernY/1eM+AM4F5pf5ZwBXAKPAHcAhDb6Xk9V6HrCuvI83A4c3/flnJv8G3yzJl2FmSQ6LWZLDYpbksJglOSxmSQ6LWZLDYpbksJgl/RebtiT+TWQaNQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "linear = LinearRegression()\n",
    "linear.fit(X,y) #将数据交给算法，学习，希望算法，找到规律\n",
    "# X ----> y 是一个圆；预测X_test返回值y_ 如果预测好，也是圆\n",
    "y_ = linear.predict(X_test)\n",
    "plt.figure(figsize=(3,3))\n",
    "plt.scatter(y_[:,0],y_[:,1])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a15ff146",
   "metadata": {},
   "source": [
    "#### 决策树回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "f96dabae",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:23:39.736264Z",
     "start_time": "2022-07-01T12:23:39.608249Z"
    },
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(199, 2)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x2029ec48f70>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAFnCAYAAABaeBU1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAXT0lEQVR4nO3df6zdd33f8eer8Ry0VW0cbAU3iWNH9QZUnRx2lKEhlQJJCPwRe2oGRkI4HcgrI500REVQ/shIixa6PzJVywZWGhJYldC6QtyqRVl+rv8QmhstxMQo+MZsi11DXAJoU6hDwnt/nK+7b67vufdjn3Puj9znQzq63+/n8/l+z9ufc3xe9/vj2KkqJElq8XMrXYAkae0wNCRJzQwNSVIzQ0OS1MzQkCQ1MzQkSc0mEhpJ7kryfJJvjehPkj9IMpfkqSRv6fXtS3Kke+ybRD2SpOmY1JHG3cC1i/S/B9jZPfYD/wUgyYXALcA/Ba4EbkmyaUI1SZImbMMkdlJVf5lk+yJDdgNfrOE3CR9LckGSrcCvAw9U1QsASR5gGD73LvZ8mzdvru3bF3s6SdJ8TzzxxN9U1ZZx9jGR0GhwMfBcb/1Y1zaqfVHbt29ndnZ2ogVK0mtdkv817j7WzIXwJPu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9O5GPZe59BvhkqRma/30lCRpGRkakqRmhoYkqZmhIUlqZmhIkpoZGpKkZoaGJKmZoSFJavb/ABWHajmeTJCtAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = DecisionTreeRegressor(criterion='squared_error',max_depth=3)\n",
    "model.fit(X,y)#X 是40个点 y是一个圆\n",
    "\n",
    "y_ = model.predict(X_test) #X_test是199点【样本】，预测y_应该是一个圆\n",
    "\n",
    "# 请问y_中有多少数据？？？\n",
    "print(y_.shape)\n",
    "\n",
    "plt.figure(figsize=(6,6))\n",
    "plt.scatter(y_[:,0],y_[:,1],color = 'green')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "98900bc4",
   "metadata": {},
   "source": [
    "#### 增加深度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "5fb04b1c",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:30:10.218089Z",
     "start_time": "2022-07-01T12:30:10.104772Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(199, 2)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x2029ff6c190>"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAFlCAYAAADoPlOZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAASSklEQVR4nO3df6jdd33H8efLhmwMdbY2a7u2MZWlsGwTdYeiDKebKdT90QhzWpksBbfAijDYHGQUHKv/+APdBha2TMeiIK0r/gjYUduoCGNxucWuoyltYrbZdLGNnQoirnZ774/7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9f5GBTmObjfj1wfZJ/THIkyU2LGm7LojZatCQPAFdOuHT7+ElVVZJJ36q0BXgd8CrgG8DdwK3Ax+Y76Y+bw+y3AfdW1alFv9icw+xnn+cq4BPA3qr63/lOqXFJ3gGMgNdv9CzTGF7QfJjlfx8vRltYvq3zBpb/q+orSX6pqr6ziI2fl6pq92rXkjyV5KqqOj2EZdJ/Up0CHqqqk8M/81ngNSwg+HOY/bXA65LcxvJ7D1uTfK+qVn3za17mMDtJXgx8Hri9qo5coFGn8SRw7dj5NcNjk9acSrIF+GngmcWMd07TzE6S3Sx/MX59Vf33gmZby1qzvwj4ReDLwwuaK4FDSW6uqqWFTTnZNB/3U8BXq+qHwL8leZzlLwBHL/RwXW/pHAL2Dsd7gc9NWHMUeEmSs/ePfx04toDZ1rLm7FX121W1vap2sHxb5+OLiP0U1pw9yVbgMyzPfM8CZ5vkKLAzyXXDXLew/GcYN/5negvwxRreidtga86e5FXAXwM3L/I+8hTOOXtVfbeqLq+qHcPn+BGW/wwbHXuY7nPmsyy/uifJ5Szf4jm5kOk2+l3tjfjF8j3Ww8Bx4AHgsuHxEfDRsXU3Ag8D/wr8HbD1Ypl9bP2tbJ7v0llzduAdwA+Bh8Z+vXIDZ/4N4HGW30e4fXjsDpYDA/CTwN8DJ4B/Bl6+0R/ndcz+APDU2Mf50EbPPO3sK9Z+mU3yXTpTftzD8i2pY0NbblnUbP6krSQ10fWWjiS1Y/AlqQmDL0lNGHxJasLgS1ITBl+SmjD4ktSEwZekJv4PbTTcAmRguPYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = DecisionTreeRegressor(criterion='squared_error',max_depth=2)\n",
    "model.fit(X,y)#X 是40个点 y是一个圆\n",
    "\n",
    "y_ = model.predict(X_test) #X_test是199点【样本】，预测y_应该是一个圆\n",
    "\n",
    "# 请问y_中有多少数据？？？\n",
    "print(y_.shape)\n",
    "\n",
    "plt.figure(figsize=(6,6))\n",
    "plt.scatter(y_[:,0],y_[:,1],color = 'green')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e70cb67c",
   "metadata": {},
   "source": [
    "#### 决策树可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "8e9a7bf8",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:30:13.357107Z",
     "start_time": "2022-07-01T12:30:13.247981Z"
    },
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Generated by graphviz version 2.48.0 (20210717.1556)\n",
       " -->\n",
       "<!-- Title: Tree Pages: 1 -->\n",
       "<svg width=\"698pt\" height=\"314pt\"\n",
       " viewBox=\"0.00 0.00 698.00 314.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 310)\">\n",
       "<title>Tree</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-310 694,-310 694,4 -4,4\"/>\n",
       "<!-- 0 -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>0</title>\n",
       "<polygon fill=\"#ffffff\" stroke=\"black\" points=\"416,-306 273,-306 273,-223 416,-223 416,-306\"/>\n",
       "<text text-anchor=\"middle\" x=\"344.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">X[0] &lt;= 3.142</text>\n",
       "<text text-anchor=\"middle\" x=\"344.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">squared_error = 0.5</text>\n",
       "<text text-anchor=\"middle\" x=\"344.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 40</text>\n",
       "<text text-anchor=\"middle\" x=\"344.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [[0.0]</text>\n",
       "<text text-anchor=\"middle\" x=\"344.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">[0.025]]</text>\n",
       "</g>\n",
       "<!-- 1 -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>1</title>\n",
       "<polygon fill=\"#f3c3a0\" stroke=\"black\" points=\"336,-187 177,-187 177,-104 336,-104 336,-187\"/>\n",
       "<text text-anchor=\"middle\" x=\"256.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">X[0] &lt;= 1.531</text>\n",
       "<text text-anchor=\"middle\" x=\"256.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">squared_error = 0.307</text>\n",
       "<text text-anchor=\"middle\" x=\"256.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 20</text>\n",
       "<text text-anchor=\"middle\" x=\"256.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [[0.62]</text>\n",
       "<text text-anchor=\"middle\" x=\"256.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">[0.025]]</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;1 -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>0&#45;&gt;1</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M313.97,-222.91C307.21,-213.92 299.98,-204.32 293.02,-195.05\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"295.79,-192.91 286.98,-187.02 290.19,-197.12 295.79,-192.91\"/>\n",
       "<text text-anchor=\"middle\" x=\"283.48\" y=\"-208.07\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">True</text>\n",
       "</g>\n",
       "<!-- 4 -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>4</title>\n",
       "<polygon fill=\"#f3c3a0\" stroke=\"black\" points=\"513,-187 354,-187 354,-104 513,-104 513,-187\"/>\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">X[0] &lt;= 4.753</text>\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">squared_error = 0.307</text>\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 20</text>\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [[&#45;0.62]</text>\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">[0.025]]</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;4 -->\n",
       "<g id=\"edge4\" class=\"edge\">\n",
       "<title>0&#45;&gt;4</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M375.38,-222.91C382.21,-213.92 389.52,-204.32 396.57,-195.05\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"399.41,-197.1 402.68,-187.02 393.84,-192.86 399.41,-197.1\"/>\n",
       "<text text-anchor=\"middle\" x=\"406.04\" y=\"-208.09\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">False</text>\n",
       "</g>\n",
       "<!-- 2 -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>2</title>\n",
       "<polygon fill=\"#e58139\" stroke=\"black\" points=\"159,-68 0,-68 0,0 159,0 159,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"79.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">squared_error = 0.098</text>\n",
       "<text text-anchor=\"middle\" x=\"79.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 10</text>\n",
       "<text text-anchor=\"middle\" x=\"79.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [[0.594]</text>\n",
       "<text text-anchor=\"middle\" x=\"79.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">[0.671]]</text>\n",
       "</g>\n",
       "<!-- 1&#45;&gt;2 -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>1&#45;&gt;2</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M190.84,-103.88C174.74,-93.92 157.55,-83.29 141.62,-73.43\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"143.26,-70.33 132.91,-68.04 139.58,-76.28 143.26,-70.33\"/>\n",
       "</g>\n",
       "<!-- 3 -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>3</title>\n",
       "<polygon fill=\"#e58139\" stroke=\"black\" points=\"336,-68 177,-68 177,0 336,0 336,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"256.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">squared_error = 0.098</text>\n",
       "<text text-anchor=\"middle\" x=\"256.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 10</text>\n",
       "<text text-anchor=\"middle\" x=\"256.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [[0.646]</text>\n",
       "<text text-anchor=\"middle\" x=\"256.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">[&#45;0.621]]</text>\n",
       "</g>\n",
       "<!-- 1&#45;&gt;3 -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>1&#45;&gt;3</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M256.5,-103.73C256.5,-95.52 256.5,-86.86 256.5,-78.56\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"260,-78.3 256.5,-68.3 253,-78.3 260,-78.3\"/>\n",
       "</g>\n",
       "<!-- 5 -->\n",
       "<g id=\"node6\" class=\"node\">\n",
       "<title>5</title>\n",
       "<polygon fill=\"#e58139\" stroke=\"black\" points=\"513,-68 354,-68 354,0 513,0 513,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">squared_error = 0.098</text>\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 10</text>\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [[&#45;0.646]</text>\n",
       "<text text-anchor=\"middle\" x=\"433.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">[&#45;0.621]]</text>\n",
       "</g>\n",
       "<!-- 4&#45;&gt;5 -->\n",
       "<g id=\"edge5\" class=\"edge\">\n",
       "<title>4&#45;&gt;5</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M433.5,-103.73C433.5,-95.52 433.5,-86.86 433.5,-78.56\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"437,-78.3 433.5,-68.3 430,-78.3 437,-78.3\"/>\n",
       "</g>\n",
       "<!-- 6 -->\n",
       "<g id=\"node7\" class=\"node\">\n",
       "<title>6</title>\n",
       "<polygon fill=\"#e58139\" stroke=\"black\" points=\"690,-68 531,-68 531,0 690,0 690,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"610.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">squared_error = 0.098</text>\n",
       "<text text-anchor=\"middle\" x=\"610.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 10</text>\n",
       "<text text-anchor=\"middle\" x=\"610.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [[&#45;0.594]</text>\n",
       "<text text-anchor=\"middle\" x=\"610.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">[0.671]]</text>\n",
       "</g>\n",
       "<!-- 4&#45;&gt;6 -->\n",
       "<g id=\"edge6\" class=\"edge\">\n",
       "<title>4&#45;&gt;6</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M499.16,-103.88C515.26,-93.92 532.45,-83.29 548.38,-73.43\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"550.42,-76.28 557.09,-68.04 546.74,-70.33 550.42,-76.28\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<graphviz.sources.Source at 0x2029ff83340>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 决策树形状\n",
    "dot_data = tree.export_graphviz(model,filled=True)\n",
    "graph = graphviz.Source(dot_data)\n",
    "graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "146485c7",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T13:27:46.585164Z",
     "start_time": "2022-07-01T13:27:46.574080Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.   , 0.025])"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.mean(axis = 0).round(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "37dac40f",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T13:29:49.933667Z",
     "start_time": "2022-07-01T13:29:49.915773Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.62 , 0.025])"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cond = X <= 3.142\n",
    "\n",
    "left = y[cond.reshape(-1)]\n",
    "left.mean(axis = 0).round(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "ee1c961f",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T13:30:27.016936Z",
     "start_time": "2022-07-01T13:30:26.996006Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.62 ,  0.025])"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cond = X <= 3.142\n",
    "\n",
    "right = y[~cond.reshape(-1)]\n",
    "right.mean(axis = 0).round(3)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0b2e3571",
   "metadata": {},
   "source": [
    "### 决策树分裂原理【mse==squared_error】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "072c1607",
   "metadata": {},
   "source": [
    "#### 整体MSE【未分裂】"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "0ff2bf40",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:42:20.169351Z",
     "start_time": "2022-07-01T12:42:20.151435Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.5"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# axis = 0表示计算列的平均值，【属性】\n",
    "round(((y - y.mean(axis = 0))**2).mean(),1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e933c500",
   "metadata": {},
   "source": [
    "#### 验证第一次裂分后，左右两个节点的mse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "0e8f7102",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:51:11.536752Z",
     "start_time": "2022-07-01T12:51:11.523762Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.307"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 0.307\n",
    "cond = (X <=3.142).reshape(-1)\n",
    "left = y[cond]\n",
    "right = y[~cond] # 非，True--->False；False --->True\n",
    "\n",
    "# 计算左边的mse\n",
    "round(((left - left.mean(axis = 0))**2).sum()/left.size,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "0ba0673f",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:51:44.177612Z",
     "start_time": "2022-07-01T12:51:44.166539Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.307"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算左边的mse\n",
    "round(((right - right.mean(axis = 0))**2).sum()/right.size,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "5b0021d1",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:51:00.215944Z",
     "start_time": "2022-07-01T12:51:00.203983Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ True,  True,  True,  True,  True,  True,  True,  True,  True,\n",
       "        True,  True,  True,  True,  True,  True,  True,  True,  True,\n",
       "        True,  True, False, False, False, False, False, False, False,\n",
       "       False, False, False, False, False, False, False, False, False,\n",
       "       False, False, False, False])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cond.reshape(-1)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7f6120f9",
   "metadata": {},
   "source": [
    "#### 手动计算最佳裂分点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "9b493f65",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T13:19:11.849593Z",
     "start_time": "2022-07-01T13:19:11.827664Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "最佳裂分条件： {3.142: 0.3072588991283228}\n"
     ]
    }
   ],
   "source": [
    "# DecisionTreeRegressor 核心代码，就是，下面的代码\n",
    "# 难的知识，没法教\n",
    "# 理解 + 练习\n",
    "split_result = {}\n",
    "mse_lower = 0.5 # 未分裂时，mse，最大的\n",
    "for i in range(len(X) - 1):\n",
    "    split = round(X[i:i+2].mean(),3)\n",
    "    cond = (X <= split).reshape(-1)\n",
    "    left = y[cond]\n",
    "    right = y[~cond]\n",
    "    mse_left = ((left - left.mean(axis = 0))**2).mean()\n",
    "    mse_right = ((right - right.mean(axis = 0))**2).mean()\n",
    "    # 计算左右叶节点比例\n",
    "    left_percent = cond.sum()/cond.size \n",
    "    right_percent = 1 - left_percent\n",
    "    # 计算整体\n",
    "    mse = mse_left * left_percent + mse_right * right_percent\n",
    "#     print(mse,left_percent,right_percent)\n",
    "    if mse < mse_lower:\n",
    "        split_result.clear()\n",
    "        split_result[split] = mse\n",
    "        mse_lower = mse # 更新记录最小mse变量\n",
    "print('最佳裂分条件：',split_result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "1f192962",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:54:24.909782Z",
     "start_time": "2022-07-01T12:54:24.887617Z"
    },
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.        , 0.16110732, 0.32221463, 0.48332195, 0.64442926,\n",
       "       0.80553658, 0.96664389, 1.12775121, 1.28885852, 1.44996584,\n",
       "       1.61107316, 1.77218047, 1.93328779, 2.0943951 , 2.25550242,\n",
       "       2.41660973, 2.57771705, 2.73882436, 2.89993168, 3.061039  ,\n",
       "       3.22214631, 3.38325363, 3.54436094, 3.70546826, 3.86657557,\n",
       "       4.02768289, 4.1887902 , 4.34989752, 4.51100484, 4.67211215,\n",
       "       4.83321947, 4.99432678, 5.1554341 , 5.31654141, 5.47764873,\n",
       "       5.63875604, 5.79986336, 5.96097068, 6.12207799, 6.28318531])"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.ravel()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "44d0353b",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T12:59:15.188732Z",
     "start_time": "2022-07-01T12:59:15.174188Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.5"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cond.sum()/cond.size"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cda54e70",
   "metadata": {},
   "source": [
    "### 决策回归树 VS 线性回归"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9229f351",
   "metadata": {},
   "source": [
    "#### 加载数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "e9f60f4a",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T13:33:51.079582Z",
     "start_time": "2022-07-01T13:33:50.893690Z"
    }
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from sklearn.tree import DecisionTreeRegressor\n",
    "from sklearn import tree\n",
    "from sklearn import datasets\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.linear_model import LinearRegression\n",
    "\n",
    "diabetes = datasets.load_diabetes() # 糖尿病\n",
    "X = diabetes['data']\n",
    "y = diabetes['target']\n",
    "X_train,X_test,y_train,y_test = train_test_split(X,y,random_state = 911)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "aa879e58",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T13:38:05.561037Z",
     "start_time": "2022-07-01T13:38:05.542545Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': array([[ 0.03807591,  0.05068012,  0.06169621, ..., -0.00259226,\n",
       "          0.01990749, -0.01764613],\n",
       "        [-0.00188202, -0.04464164, -0.05147406, ..., -0.03949338,\n",
       "         -0.06833155, -0.09220405],\n",
       "        [ 0.08529891,  0.05068012,  0.04445121, ..., -0.00259226,\n",
       "          0.00286131, -0.02593034],\n",
       "        ...,\n",
       "        [ 0.04170844,  0.05068012, -0.01590626, ..., -0.01107952,\n",
       "         -0.04688253,  0.01549073],\n",
       "        [-0.04547248, -0.04464164,  0.03906215, ...,  0.02655962,\n",
       "          0.04452873, -0.02593034],\n",
       "        [-0.04547248, -0.04464164, -0.0730303 , ..., -0.03949338,\n",
       "         -0.00422151,  0.00306441]]),\n",
       " 'target': array([151.,  75., 141., 206., 135.,  97., 138.,  63., 110., 310., 101.,\n",
       "         69., 179., 185., 118., 171., 166., 144.,  97., 168.,  68.,  49.,\n",
       "         68., 245., 184., 202., 137.,  85., 131., 283., 129.,  59., 341.,\n",
       "         87.,  65., 102., 265., 276., 252.,  90., 100.,  55.,  61.,  92.,\n",
       "        259.,  53., 190., 142.,  75., 142., 155., 225.,  59., 104., 182.,\n",
       "        128.,  52.,  37., 170., 170.,  61., 144.,  52., 128.,  71., 163.,\n",
       "        150.,  97., 160., 178.,  48., 270., 202., 111.,  85.,  42., 170.,\n",
       "        200., 252., 113., 143.,  51.,  52., 210.,  65., 141.,  55., 134.,\n",
       "         42., 111.,  98., 164.,  48.,  96.,  90., 162., 150., 279.,  92.,\n",
       "         83., 128., 102., 302., 198.,  95.,  53., 134., 144., 232.,  81.,\n",
       "        104.,  59., 246., 297., 258., 229., 275., 281., 179., 200., 200.,\n",
       "        173., 180.,  84., 121., 161.,  99., 109., 115., 268., 274., 158.,\n",
       "        107.,  83., 103., 272.,  85., 280., 336., 281., 118., 317., 235.,\n",
       "         60., 174., 259., 178., 128.,  96., 126., 288.,  88., 292.,  71.,\n",
       "        197., 186.,  25.,  84.,  96., 195.,  53., 217., 172., 131., 214.,\n",
       "         59.,  70., 220., 268., 152.,  47.,  74., 295., 101., 151., 127.,\n",
       "        237., 225.,  81., 151., 107.,  64., 138., 185., 265., 101., 137.,\n",
       "        143., 141.,  79., 292., 178.,  91., 116.,  86., 122.,  72., 129.,\n",
       "        142.,  90., 158.,  39., 196., 222., 277.,  99., 196., 202., 155.,\n",
       "         77., 191.,  70.,  73.,  49.,  65., 263., 248., 296., 214., 185.,\n",
       "         78.,  93., 252., 150.,  77., 208.,  77., 108., 160.,  53., 220.,\n",
       "        154., 259.,  90., 246., 124.,  67.,  72., 257., 262., 275., 177.,\n",
       "         71.,  47., 187., 125.,  78.,  51., 258., 215., 303., 243.,  91.,\n",
       "        150., 310., 153., 346.,  63.,  89.,  50.,  39., 103., 308., 116.,\n",
       "        145.,  74.,  45., 115., 264.,  87., 202., 127., 182., 241.,  66.,\n",
       "         94., 283.,  64., 102., 200., 265.,  94., 230., 181., 156., 233.,\n",
       "         60., 219.,  80.,  68., 332., 248.,  84., 200.,  55.,  85.,  89.,\n",
       "         31., 129.,  83., 275.,  65., 198., 236., 253., 124.,  44., 172.,\n",
       "        114., 142., 109., 180., 144., 163., 147.,  97., 220., 190., 109.,\n",
       "        191., 122., 230., 242., 248., 249., 192., 131., 237.,  78., 135.,\n",
       "        244., 199., 270., 164.,  72.,  96., 306.,  91., 214.,  95., 216.,\n",
       "        263., 178., 113., 200., 139., 139.,  88., 148.,  88., 243.,  71.,\n",
       "         77., 109., 272.,  60.,  54., 221.,  90., 311., 281., 182., 321.,\n",
       "         58., 262., 206., 233., 242., 123., 167.,  63., 197.,  71., 168.,\n",
       "        140., 217., 121., 235., 245.,  40.,  52., 104., 132.,  88.,  69.,\n",
       "        219.,  72., 201., 110.,  51., 277.,  63., 118.,  69., 273., 258.,\n",
       "         43., 198., 242., 232., 175.,  93., 168., 275., 293., 281.,  72.,\n",
       "        140., 189., 181., 209., 136., 261., 113., 131., 174., 257.,  55.,\n",
       "         84.,  42., 146., 212., 233.,  91., 111., 152., 120.,  67., 310.,\n",
       "         94., 183.,  66., 173.,  72.,  49.,  64.,  48., 178., 104., 132.,\n",
       "        220.,  57.]),\n",
       " 'frame': None,\n",
       " 'DESCR': '.. _diabetes_dataset:\\n\\nDiabetes dataset\\n----------------\\n\\nTen baseline variables, age, sex, body mass index, average blood\\npressure, and six blood serum measurements were obtained for each of n =\\n442 diabetes patients, as well as the response of interest, a\\nquantitative measure of disease progression one year after baseline.\\n\\n**Data Set Characteristics:**\\n\\n  :Number of Instances: 442\\n\\n  :Number of Attributes: First 10 columns are numeric predictive values\\n\\n  :Target: Column 11 is a quantitative measure of disease progression one year after baseline\\n\\n  :Attribute Information:\\n      - age     age in years\\n      - sex\\n      - bmi     body mass index\\n      - bp      average blood pressure\\n      - s1      tc, total serum cholesterol\\n      - s2      ldl, low-density lipoproteins\\n      - s3      hdl, high-density lipoproteins\\n      - s4      tch, total cholesterol / HDL\\n      - s5      ltg, possibly log of serum triglycerides level\\n      - s6      glu, blood sugar level\\n\\nNote: Each of these 10 feature variables have been mean centered and scaled by the standard deviation times the square root of `n_samples` (i.e. the sum of squares of each column totals 1).\\n\\nSource URL:\\nhttps://www4.stat.ncsu.edu/~boos/var.select/diabetes.html\\n\\nFor more information see:\\nBradley Efron, Trevor Hastie, Iain Johnstone and Robert Tibshirani (2004) \"Least Angle Regression,\" Annals of Statistics (with discussion), 407-499.\\n(https://web.stanford.edu/~hastie/Papers/LARS/LeastAngle_2002.pdf)\\n',\n",
       " 'feature_names': ['age',\n",
       "  'sex',\n",
       "  'bmi',\n",
       "  'bp',\n",
       "  's1',\n",
       "  's2',\n",
       "  's3',\n",
       "  's4',\n",
       "  's5',\n",
       "  's6'],\n",
       " 'data_filename': 'diabetes_data_raw.csv.gz',\n",
       " 'target_filename': 'diabetes_target.csv.gz',\n",
       " 'data_module': 'sklearn.datasets.data'}"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "diabetes"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "348ad8a5",
   "metadata": {},
   "source": [
    "#### 线性回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "af864c78",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T13:34:17.434526Z",
     "start_time": "2022-07-01T13:34:17.414451Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.4139431540140994"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "linear = LinearRegression()\n",
    "linear.fit(X_train,y_train)\n",
    "linear.score(X_test,y_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "13780939",
   "metadata": {},
   "source": [
    "#### 决策树"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "8c6870e8",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T13:36:25.999038Z",
     "start_time": "2022-07-01T13:36:25.983967Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.13238032562994362"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model = DecisionTreeRegressor()\n",
    "model.fit(X_train,y_train)\n",
    "model.score(X_test,y_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "413ab011",
   "metadata": {},
   "source": [
    "#### 筛选超参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "3e1a8c31",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2022-07-01T13:45:49.734355Z",
     "start_time": "2022-07-01T13:45:49.591871Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0.5, 1.0, '决策树R2随着深度变化')"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEuCAYAAACd7SWvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA81ElEQVR4nO3dd3hUZfbA8e9JS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dgYhjHGmJBYwjAmznhrSZ0O9BSR4SJySLRjMlWDDXobE2e8wfwC3JhLEu7/sV2sZyLOEoYxxpiQWJeUMcaYkFjCMMYYExJLGMYYY0JiCcMYY0xILGEYY4wJyf8D+Q8jOC5/CfoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "plt.rcParams['font.family'] = 'STKaiti'\n",
    "max_depth = np.arange(1,16)\n",
    "score1 = [] # 测试\n",
    "score2 = [] # 训练\n",
    "for d in max_depth:\n",
    "    model = DecisionTreeRegressor(max_depth = d)\n",
    "    model.fit(X_train,y_train)\n",
    "    score1.append(model.score(X_test,y_test))\n",
    "    score2.append(model.score(X_train,y_train))\n",
    "    \n",
    "plt.plot(max_depth,score1,'ro-')\n",
    "plt.plot(max_depth,score2,'go-')\n",
    "plt.xlabel('max_depth',fontsize = 18)\n",
    "plt.ylabel('Score',fontsize = 18)\n",
    "plt.title('决策树R2随着深度变化',pad = 20,fontsize = 20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9e4ce576",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "232px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
